diff --git a/git.json.php b/git.json.php new file mode 100644 index 000000000..a35914f58 --- /dev/null +++ b/git.json.php @@ -0,0 +1,20 @@ +&1", $output, $return_val); + +$obj = new stdClass(); + +$obj->output = $output; + +foreach ($output as $value){ + + preg_match("/Date:(.*)/i", $value, $match); + if(!empty($match[1])){ + $obj->date = strtotime($match[1]); + $obj->dateString = trim($match[1]); + $obj->dateMySQL = date("Y-m-d H:i:s", $obj->date); + } +} + +echo json_encode($obj); diff --git a/plugin/CustomizeUser/actionButton.php b/plugin/CustomizeUser/actionButton.php index d2a38d58c..335c8a6e4 100644 --- a/plugin/CustomizeUser/actionButton.php +++ b/plugin/CustomizeUser/actionButton.php @@ -1,13 +1,13 @@ allowDonationLink) { +if ($obj->allowDonationLink && !empty($video['users_id'])) { $u = new User($video['users_id']); $donationLink = $u->getDonationLink(); if (!empty($donationLink)) { ?> \ No newline at end of file diff --git a/plugin/Live/Objects/LiveTransmition.php b/plugin/Live/Objects/LiveTransmition.php index 6c0210f0c..9749399da 100644 --- a/plugin/Live/Objects/LiveTransmition.php +++ b/plugin/Live/Objects/LiveTransmition.php @@ -1,244 +1,245 @@ id; } function getTitle() { return $this->title; } function getPublic() { return $this->public; } function getSaveTransmition() { return $this->saveTransmition; } function getUsers_id() { return $this->users_id; } function getCategories_id() { return $this->categories_id; } function getKey() { return $this->key; } function getDescription() { return $this->description; } function setId($id) { $this->id = $id; } function setTitle($title) { global $global; //$title = $global['mysqli']->real_escape_string($title); $this->title = xss_esc($title); } function setPublic($public) { $this->public = $public; } function setSaveTransmition($saveTransmition) { $this->saveTransmition = $saveTransmition; } function setUsers_id($users_id) { $this->users_id = $users_id; } function setCategories_id($categories_id) { $this->categories_id = $categories_id; } function setKey($key) { $this->key = $key; } function setDescription($description) { global $global; //$description = $global['mysqli']->real_escape_string($description); $this->description = xss_esc($description); } function loadByUser($user_id) { $user = self::getFromDbByUser($user_id); if (empty($user)) return false; foreach ($user as $key => $value) { $this->$key = $value; } return true; } static function getFromDbByUser($user_id) { global $global; $user_id = intval($user_id); $sql = "SELECT * FROM " . static::getTableName() . " WHERE users_id = ? LIMIT 1"; $res = sqlDAL::readSql($sql, "i", array($user_id), true); $data = sqlDAL::fetchAssoc($res); sqlDAL::close($res); if ($res != false) { $user = $data; } else { $user = false; } return $user; } static function createTransmitionIfNeed($user_id) { if(empty($user_id)){ return false; } $row = static::getFromDbByUser($user_id); if ($row) { return $row; } $l = new LiveTransmition(0); $l->setTitle("Empty Title"); $l->setDescription(""); $l->setKey(uniqid()); $l->setCategories_id(1); $l->setUsers_id($user_id); $l->save(); return static::getFromDbByUser($user_id); } static function resetTransmitionKey($user_id) { $row = static::getFromDbByUser($user_id); $l = new LiveTransmition($row['id']); $l->setKey(uniqid()); return $l->save(); } static function getFromDbByUserName($userName) { global $global; $userName = $global['mysqli']->real_escape_string($userName); $sql = "SELECT * FROM users WHERE user = ? LIMIT 1"; $res = sqlDAL::readSql($sql, "s", array($userName), true); $data = sqlDAL::fetchAssoc($res); sqlDAL::close($res); if ($res != false) { $user = $data; return static::getFromDbByUser($user['id']); } else { return false; } } static function keyExists($key) { global $global; + $key = preg_replace("/[^A-Za-z0-9]/", '', $key); if (!is_string($key)) { return false; } $sql = "SELECT u.*, lt.* FROM " . static::getTableName() . " lt " . " LEFT JOIN users u ON u.id = users_id AND u.status='a' WHERE `key` = '$key' LIMIT 1"; $res = sqlDAL::readSql($sql); $data = sqlDAL::fetchAssoc($res); sqlDAL::close($res); if ($res) { $row = $data; } else { $row = false; } return $row; } function save() { $this->public = intval($this->public); $this->saveTransmition = intval($this->saveTransmition); return parent::save(); } function deleteGroupsTrasmition() { if (empty($this->id)) { return false; } global $global; $sql = "DELETE FROM live_transmitions_has_users_groups WHERE live_transmitions_id = ?"; return sqlDAL::writeSql($sql, "i", array($this->id)); } function insertGroup($users_groups_id) { global $global; $sql = "INSERT INTO live_transmitions_has_users_groups (live_transmitions_id, users_groups_id) VALUES (?,?)"; return sqlDAL::writeSql($sql, "ii", array($this->id, $users_groups_id)); } function getGroups() { $rows = array(); if (empty($this->id)) { return $rows; } global $global; $sql = "SELECT * FROM live_transmitions_has_users_groups WHERE live_transmitions_id = ?"; $res = sqlDAL::readSql($sql, "i", array($this->id)); $fullData = sqlDAL::fetchAllAssoc($res); sqlDAL::close($res); if ($res != false) { foreach ($fullData as $row) { $rows[] = $row["users_groups_id"]; } } else { die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error); } return $rows; } function userCanSeeTransmition() { global $global; require_once $global['systemRootPath'] . 'objects/userGroups.php'; require_once $global['systemRootPath'] . 'objects/user.php'; if (User::isAdmin()) { return true; } $transmitionGroups = $this->getGroups(); if (!empty($transmitionGroups)) { if (empty($this->id)) { return false; } if (!User::isLogged()) { return false; } $userGroups = UserGroups::getUserGroups(User::getId()); if (empty($userGroups)) { return false; } foreach ($userGroups as $ugvalue) { foreach ($transmitionGroups as $tgvalue) { if ($ugvalue['id'] == $tgvalue) { return true; } } } return false; } else { return true; } } } diff --git a/plugin/Live/view/modeYoutubeLive.php b/plugin/Live/view/modeYoutubeLive.php index 70ac672d2..022c3b01f 100644 --- a/plugin/Live/view/modeYoutubeLive.php +++ b/plugin/Live/view/modeYoutubeLive.php @@ -1,142 +1,148 @@ getBdId(); +$video['users_id'] = $user_id; $subscribe = Subscribe::getButton($user_id); $name = $u->getNameIdentificationBd(); $name = "{$name} " . User::getEmailVerifiedIcon($user_id) . ""; $video['creator'] = '
' . $name . '
' . $subscribe . '
'; $img = "{$global['webSiteRootURL']}plugin/Live/getImage.php?u={$_GET['u']}&format=jpg"; $imgw = 640; $imgh = 360; $liveDO = YouPHPTubePlugin::getObjectData("Live"); ?> <?php echo $livet['title']; ?> - <?php echo __("Live Video"); ?> - <?php echo $config->getWebSiteTitle(); ?> - getWebSiteTitle(); ?>" /> " /> userCanSeeTransmition()) { ?>

- +
+
+ + +
+

disableDVR)) { ?> getChat($uuid); } ?> diff --git a/plugin/PlayLists/PlayLists.php b/plugin/PlayLists/PlayLists.php index 1587cd561..2aefa13b2 100644 --- a/plugin/PlayLists/PlayLists.php +++ b/plugin/PlayLists/PlayLists.php @@ -1,191 +1,194 @@ playOnSelect = true; $obj->autoadvance = true; $obj->usersCanOnlyCreatePlayListsFromTheirContent = false; $obj->useOldPlayList = false; $obj->expandPlayListOnChannels = false; $obj->usePlaylistPlayerForSeries = true; return $obj; } public function getWatchActionButton($videos_id) { global $global; if (!self::canAddVideoOnPlaylist($videos_id)) { return ""; } $obj = $this->getDataObject(); //echo "getNetflixActionButton: ".$videos_id; $btnClass = "btn btn-default no-outline"; include $global['systemRootPath'] . 'plugin/PlayLists/actionButton.php'; } public function getNetflixActionButton($videos_id) { global $global; if (!self::canAddVideoOnPlaylist($videos_id)) { return ""; } $obj = $this->getDataObject(); //echo "getNetflixActionButton: ".$videos_id; $btnClass = "btn btn-primary"; include $global['systemRootPath'] . 'plugin/PlayLists/actionButton.php'; } public function getGalleryActionButton($videos_id) { global $global; if (!self::canAddVideoOnPlaylist($videos_id)) { return ""; } $obj = $this->getDataObject(); //echo "getNetflixActionButton: ".$videos_id; $btnClass = "text-primary"; echo '
'; include $global['systemRootPath'] . 'plugin/PlayLists/actionButton.php'; echo '
'; } public function getHeadCode() { global $global; $obj = $this->getDataObject(); $css = ''; return $css; } public function getFooterCode() { global $global; $obj = $this->getDataObject(); include $global['systemRootPath'] . 'plugin/PlayLists/footer.php'; } static function canAddVideoOnPlaylist($videos_id) { + if(empty($videos_id)){ + return false; + } $obj = YouPHPTubePlugin::getObjectData("PlayLists"); if (!User::isAdmin() && $obj->usersCanOnlyCreatePlayListsFromTheirContent) { if (User::isLogged()) { $users_id = Video::getOwner($videos_id); if (User::getId() == $users_id) { return true; } } return false; } return true; } static function isVideoOnFavorite($videos_id, $users_id) { return PlayList::isVideoOnFavorite($videos_id, $users_id); } static function isVideoOnWatchLater($videos_id, $users_id) { return PlayList::isVideoOnWatchLater($videos_id, $users_id); } static function getFavoriteIdFromUser($users_id) { return PlayList::getFavoriteIdFromUser($users_id); } static function getWatchLaterIdFromUser($users_id) { return PlayList::getWatchLaterIdFromUser($users_id); } public function thumbsOverlay($videos_id) { global $global; include $global['systemRootPath'] . 'plugin/PlayLists/buttons.php'; } static function isPlayListASerie($serie_playlists_id) { global $global, $config; $serie_playlists_id = intval($serie_playlists_id); $sql = "SELECT * FROM videos WHERE serie_playlists_id = ? LIMIT 1"; $res = sqlDAL::readSql($sql, "i", array($serie_playlists_id), true); $video = sqlDAL::fetchAssoc($res); sqlDAL::close($res); return $video; } static function removeSerie($serie_playlists_id) { $video = self::isPlayListASerie($serie_playlists_id); if (!empty($video)) { $video = new Video("", "", $video['id']); $video->delete(); } } static function saveSerie($serie_playlists_id) { $playlist = new PlayList($serie_playlists_id); if (empty($playlist)) { return false; } $video = self::isPlayListASerie($serie_playlists_id); if (!empty($video)) { $filename = $video['filename']; $v = new Video("", "", $video['id']); } else { $filename = 'serie_playlists_' . uniqid(); $v = new Video("", $filename); } $v->setTitle($playlist->getName()); $v->setSerie_playlists_id($serie_playlists_id); $v->setUsers_id($playlist->getUsers_id()); $v->setStatus('u'); $v->setFilename($filename); $v->setType("serie"); return $v->save(); } public function getStart() { global $global; if (!empty($_GET['videoName'])) { $obj = $this->getDataObject(); if ($obj->usePlaylistPlayerForSeries) { $video = Video::getVideoFromCleanTitle($_GET['videoName']); if ($video['type'] == 'serie' && !empty($video['serie_playlists_id'])) { $link = PlayLists::getLink($video['serie_playlists_id']); header("Location: {$link}"); exit; } } } } static function getLink($playlists_id) { global $global; $obj = YouPHPTubePlugin::getObjectData("PlayLists"); if (empty($obj->useOldPlayList)) { return $global['webSiteRootURL'] . "plugin/PlayLists/player.php?playlists_id=" . $playlists_id; } else { return $global['webSiteRootURL'] . "playlist/" . $playlists_id; } } } diff --git a/plugin/YouPHPFlix2/YouPHPFlix2.php b/plugin/YouPHPFlix2/YouPHPFlix2.php index e4b80c22b..80492785c 100644 --- a/plugin/YouPHPFlix2/YouPHPFlix2.php +++ b/plugin/YouPHPFlix2/YouPHPFlix2.php @@ -1,118 +1,119 @@ Help"; return $txt.$help; } public function getName() { return "YouPHPFlix2"; } public function getUUID() { return "e3a568e6-ef61-4dcc-aad0-0109e9be8e36"; } public function getPluginVersion() { return "1.0"; } public function getEmptyDataObject() { global $global; $obj = new stdClass(); + $obj->hidePrivateVideos = false; $obj->pageDots = true; $obj->PlayList = true; $obj->PlayListAutoPlay = true; $obj->Trending = true; $obj->TrendingAutoPlay = true; $obj->DateAdded = true; $obj->DateAddedAutoPlay = true; $obj->MostPopular = true; $obj->MostPopularAutoPlay = true; $obj->MostWatched = true; $obj->MostWatchedAutoPlay = true; $obj->Categories = true; $obj->CategoriesAutoPlay = true; $obj->maxVideos = 20; $obj->SortByName = false; $obj->BigVideo = true; $obj->RemoveBigVideoDescription = false; $obj->BigVideoPlayIcon = true; $obj->BigVideoMarginBottom = "-350px"; $obj->backgroundRGB = "20,20,20"; $obj->landscapePosters = true; $obj->playVideoOnFullscreen = true; $obj->youtubeModeOnFullscreen = false; $obj->paidOnlyLabelOverPoster = false; $obj->titleLabel = true; $obj->titleLabelOverPoster = false; $obj->titleLabelCSS = ""; return $obj; } public function getHelp(){ if(User::isAdmin()){ return "

YouPHPFlix options (admin)

Option-nameDefaultDescription
DefaultDesigncheckedThe original style, for each category, one row with the newest videos
DateAdded,MostPopular,MostWatched,SortByNamechecked,checked,checked,uncheckedMetacategories
LiteDesignunchecked All categories in one row
separateAudiouncheckedCreate a own row for audio
"; } return ""; } public function getFirstPage(){ global $global; if(!YouPHPTubePlugin::isEnabled("d3sa2k4l3-23rds421-re323-4ae-423")){ return $global['systemRootPath'].'plugin/YouPHPFlix2/view/modeFlix.php'; } } public function getHeadCode() { global $global; $obj = $this->getDataObject(); $css = ""; //$css .= "theme.".css\" rel=\"stylesheet\" type=\"text/css\"/>"; $css .= ""; if(!empty($obj->youtubeModeOnFullscreen) && !empty($_GET['videoName'])){ $css .= ''; $css .= ''; } if(!empty($obj->youtubeModeOnFullscreen)){ $css .= ''; } return $css; } static function getLinkToVideo($videos_id){ $obj = YouPHPTubePlugin::getObjectData("YouPHPFlix2"); $link = Video::getLinkToVideo($videos_id); if(!empty($obj->playVideoOnFullscreen)){ $link = parseVideos($link, 1, 0, 0, 0, 1); } return $link; } public function getFooterCode() { $obj = $this->getDataObject(); global $global; $js = ''; if(!empty($obj->playVideoOnFullscreen)){ $js = ''; }else{ $js = ''; } $js .= ''; return $js; } public function getTags() { return array('free', 'firstPage', 'netflix'); } }